import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {
    'path':'/login',
    'name':'login',
    'component':() => import('@/views/login/index')
  },
  {
    path:'/search',
    name:'search',
    component:()=>import('@/views/search')
  },
  {
    path:'/ArticleDetaile/:artid',
    name:'ArticleDetaile',
    component:()=>import('@/views/detaile'),
    props:true,
  },
  {
    path:'/reply',
    name:'reply',
    component:()=>import('@/views/reply/reply')
  },
  {
    path:'/xiaoai',
    name:'xiaoai',
    component:()=>import('@/views/xiaoai/index')
  },
  {
    path:'/userprofile',
    name:'userprofile',
    component:()=>import('@/views/userprofile/index')
  },
  {
    path:'/userhistorylist',
    name:'userhistorylist',
    component:()=>import('@/views/user/hislist')
  },
  {
    path:'/userfavoriteslist',
    name:'userhistorylist',
    component:()=>import('@/views/user/likelist')
  },
  {
    path:'/userfocusfans/:id',
    props:true,
    name:'userfocusfans',
    component:()=>import('@/views/user/focus_fans')
  },
  {
    path: '/',
    name:'lay',
    component:()=>import('@/views/lay'),
    redirect:'/home',
    children:[
      {
        path:'home',
        name:'home',
        component:()=>import('@/views/home'),
        meta: {
        	keepAlive: true  // 需要缓存
      	}
      },
      {
        path:'wenda',
        name:'wenda',
        component:()=>import('@/views/wenda')
      },
      {
        path:'videos',
        name:'videos',
        component:()=>import('@/views/videos')
      },
      {
        path:'user',
        name:'user',
        component:()=>import('@/views/user'),
        
      },
      
    ],
  },
  
]
const router = new VueRouter({
  routes
})

export default router
